﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DotSpatial.Topology;

namespace GWApplication
{


    [Serializable]
    public class TLine:TBase
    {


        /// <summary>
        /// 这里只是一个测试用的，永远不要用于实际
        /// </summary>
        /// <param name="id"></param>
        /// <param name="allCoords"></param>
        public TLine(string id, List<Coordinate> allCoords):base(id)
        {

            this._line = new LineString(allCoords);

        }


        public TLine(string id ,TNode start,TNode end,List<Coordinate> coords):base(id)
        {

            this._startNode = start;
            this._endNode = end;


            this._coords = coords;


            List<Coordinate> temp = new List<Coordinate>();

            temp.Add(this._startNode.Point.Coordinate);

            temp.AddRange(this._coords);

            temp.Add(this._endNode.Point.Coordinate);


            this._line = new LineString(temp);


            
 
        }



        LineString _line;

        /// <summary>
        /// 用于表示实际的线物体
        /// </summary>
        public LineString Line
        {
            get { 


                
                return _line; 
            
            }
            set { _line = value; }
        }


        TNode _startNode;

        public TNode StartNode
        {
            get { return _startNode; }
            set { _startNode = value; }
        }
        

        TNode _endNode;

        public TNode EndNode
        {
            get { return _endNode; }
            set { _endNode = value; }
        }


        List<Coordinate> _coords = new List<Coordinate>();


    }



}
